<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    let str = 'abc'
    let arr = ['a','b','c']
    let obj = {
        name:'abc',
        age:12
    }
    // string
    console.log('---string---')
    for(let a of str){
        console.log(a) // a b c
    }
    for(let a in str){
        console.log(a) // 0 2 3
    }
    
    // array
    console.log('---array---')
    for(let a of arr){
        console.log(a) // a b c
    }
    for(let a in str){
        console.log(a) // 0 1 2
    }
    
    // object
    console.log('---object---')
    for(let a of Object.keys(obj)){
        console.log(a)
    }
    for(let a in obj){
        console.log(a) // name age
    }
    
    
</script>
</body>
</html>